package com.nianzhen.student.fra;

import com.nainzhen.user.UserExActivity;
import com.nainzhen.user.UserGradActivity;
import com.nainzhen.user.UserHeadActivity;
import com.nainzhen.user.UserinfoDetailActivity;
import com.nianzhen.recruitment.BaseFragment;
import com.nianzhen.recruitment.R;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

/**
 * 这是个人信息界面
 * 
 * @author nianzhen 2015年4月1日20:40:51
 */
public class Userinfo extends BaseFragment implements OnClickListener {
	private LinearLayout mheadLayout;
	private LinearLayout mUserInfoLayout;
	private LinearLayout mGrlLayout;
	private LinearLayout mJobLayout;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		return inflater.inflate(R.layout.userinfo, container, false);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);
		init();
	}

	private void init() {
		// TODO Auto-generated method stub
		setTitle("个人信息");
		mheadLayout = (LinearLayout) getView().findViewById(R.id.user_head_li);
		mUserInfoLayout = (LinearLayout) getView().findViewById(
				R.id.user_info_li);
		mGrlLayout = (LinearLayout) getView().findViewById(
				R.id.user_info_school_li);
		mJobLayout = (LinearLayout) getView().findViewById(
				R.id.user_info_merry_li);
		mheadLayout.setOnClickListener(this);
		mUserInfoLayout.setOnClickListener(this);
		mGrlLayout.setOnClickListener(this);
		mJobLayout.setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.user_head_li:
			//
			startActivity(new Intent(getActivity(),UserHeadActivity.class));
			break;
		case R.id.user_info_li:
			startActivity(new Intent(getActivity(),UserinfoDetailActivity.class));
			break;
		case R.id.user_info_school_li:
			startActivity(new Intent(getActivity(),UserGradActivity.class));
			break;
		case R.id.user_info_merry_li:
			startActivity(new Intent(getActivity(),UserExActivity.class));
			break;
		default:
			break;
		}
	}

}
